<template>
    <div class="dialoglistDiv">
        <div class="searchDiv">
            <DatePicker v-model:value="obj.req.day" width="150" class="mr10"/>
            <span class="btn search" @click="init">搜索</span>
            <span class="btn refresh" @click="obj.req.currentpage=1;init()"></span>
            <div class="searchRight">
            </div>
        </div>
        <div class="table_box"><div class="table_" id="tb">
            <ul class="head">
                <li class="liflex">企业名称</li>
                <li class="liday">预约日期</li>
                <li class="mw200">报名时间</li>
            </ul>
            <div class="body">
                <ul v-for="x in obj.ary" :key="x">
                    <li class="liaction liflex">
                        <u @click.prevent="edit(x)">{{x.companyname}}</u>
                    </li>
                    <!-- <li class="liflex">{{x.companyname}}</li> -->
                    <li class="liday">{{x.day}}</li>
                    <li class="mw200">{{x.intime}}</li>
                </ul>
            </div>
        </div>
        </div><Pager :value="obj.req" :init="init" />
        <el-dialog v-model="obj.drawer.design" :title="obj.drawer.designTitle" width="1380px" :close-on-click-modal="false" :destroy-on-close="true">
            <Compamy :company_id="obj.drawer.company_id"></Compamy>
        </el-dialog>
    </div>
</template>

<script setup>
    import { reactive, getCurrentInstance, ref, toRefs, provide, computed } from 'vue'
    import Pager from '@/components/pager.vue'
    import Compamy from "./company_detail.vue"
    import DatePicker from '@/components/date_picker.vue'
    let { proxy } = getCurrentInstance()
    const props = defineProps({
        jobfair_id: { type: String },
        day: { type: String }
    })

    let obj = reactive({
        ary: [],
        req: {
            currentpage: 1,
            pagesize: 10,
            count: 0,
            id: props.jobfair_id,
            day: props.day,
        },
        drawer: {
            design: false,
            designTitle: "",
            company_id:"",
        },
    });
    let init = () => {
        proxy.$ajax({
            url: 'jobfair/sign_company',
            data: obj.req,
            bfLoading: true
        }).then(d => {
            // console.log(d)
            if(d.success){
                obj.ary = d.msg.list
                obj.req.count = d.msg.count
            }
        }).catch(() => { })
    }

    let edit = x => {
        obj.drawer.design = true
        obj.drawer.designTitle = "查看企业资料"
        obj.drawer.company_id = x.company_id;
    }

</script>

<style scoped>
    ::-webkit-scrollbar { width:10px; background-color: #FFFFFF; }
    .listDiv { top:70px; }
    #tb ul li.li2 { width: 70px; }
    #tb ul li.li3 { width: 70px; }
</style>